# 作者: 陈其志 
# 2025年02月25日09时23分16秒 
# 2716847110@qq.com
import copy
import sys


class Gun:

    def __init__(self, model, bullet):
        # 枪的型号
        self.model = model
        # 弹夹子弹数量
        self.bullet_init = bullet
        # 现有子弹数量
        self.current_bullet = bullet


class Soldier:

    def __init__(self, name):
        self.name = name
        self.gun = None

    def fire(self):
        if self.gun is None:
            print(f"{self.name}没有枪")
            return
        else:
            self.gun.current_bullet -= 1


if __name__ == '__main__':
    xu_san_duo = Soldier('许三多')
    ak47 = Gun('AK47', 35)
    xu_san_duo.gun = ak47
    xu2 = copy.copy(xu_san_duo)
    xu3 = copy.deepcopy(xu_san_duo)
    xu_san_duo.fire()
    print(xu2.gun.current_bullet)
    print(xu3.gun.current_bullet)
